<script>
  export let receiveCount;
  export let receiveStr = 'is a string'

  let count = 0

  $: if (count > 9) {
    count = 9
    alert(`count is dangerously high!`)
  }

  function handleCick() {
    count += 1;
  }
</script>

<button on:click={handleCick}>点我 {count}</button> {count >= 9 ? "count is dangerously high!" : count}
我接收到的值是：{receiveCount}
默认值是：{receiveStr}

{#if count < 3}
    <p>我是count小于3的时候显示的</p>
{:else if count >= 3 && count <= 6} 
    <p>我是count 大于等于 3 并且 小于等于 6的时候显示的</p>
{:else}
    <p>我是不符合的时候显示的</p>
{/if}

